import re
html = """
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>正则测试1</h1>
<h1>正则测试2</h1>
<ul>
    <li><a href="https://www.baidu.com">百度1</a></li>
    <li><a href="https://www.baidu.com">百度2</a></li>
    <li><a href="https://www.baidu.com">百度3</a></li>
    <li><a href="https://www.baidu.com">百度4</a></li>
    <li><a href="https://www.baidu.com">百度5</a></li>
    <li><a href="https://www.baidu.com">百度6</a></li>
</ul>
</body>
</html>
"""
a = re.search(r' <li><a href="https://www.baidu.com">(.*?)</a></li>',html)
print(a.start())
print(a.group())
print(a.end())
b = re.findall(r'<li><a href="https://www.baidu.com">(.*?)</a></li>', html)
print(b)

